const { mysql } = require('../qcloud')

module.exports = async(ctx) => {
    //接收从前端传递的data
    const { id, note } = ctx.request.body

    try {
        await mysql('records').where('id', id).update('note', note)

        ctx.state.data = {
            code: 0,
            mag: 'success'
        }
    } catch (e) {
        ctx.state = {
            code: -1,
            data: {
                msg: '操作失败' + e.sqlMessage
            }
        }
    }
}